<template>
	<view class="hs-panel">
		<view class="hs-panel-head">
			<view class="title">
				<text>合同信息</text>
				<!-- <text>{{ order.order_type }}</text> -->
			</view>
		</view>
		<view class="hs-panel-body">
			<view class="hs-list-item" v-if="order.news_type">
				<view class="hs-list-item-left"><text>订单类型</text></view>
				<view class="hs-list-item-right">{{ dictionary.getPickerTitle('newsTypeList', order.news_type) }}</view>
			</view>
			<view class="hs-list-item" v-if="order.company_id">
				<view class="hs-list-item-left"><text>订单归属公司</text></view>
				<view class="hs-list-item-right">{{ dictionary.getPickerTitle('companyList', order.company_id) }}</view>
			</view>
			<view class="hs-list-item" v-if="[0, 2].includes(order.news_type)">
				<view class="hs-list-item-left"><text>合作模式</text></view>
				<view class="hs-list-item-right">{{ dictionary.getPickerTitle('cooperationModeList', order.cooperation_mode) }}</view>
			</view>
			<view class="hs-list-item" v-if="order.contract_no">
				<view class="hs-list-item-left"><text>合同编号</text></view>
				<view class="hs-list-item-right">{{ order.contract_no }}</view>
			</view>
			<view class="hs-list-item" v-if="order.hotel_text">
				<view class="hs-list-item-left"><text>酒店名称</text></view>
				<view class="hs-list-item-right">{{ order.hotel_text }}</view>
			</view>
			<template v-if="!['11','12'].includes(order.news_type)">
			<view class="hs-list-item" v-if="order.banquet_type && order.banquet_type.length > 0">
					<view class="hs-list-item-left"><text>宴会类型</text></view>
					<view class="hs-list-item-right">{{dictionary.convertBanquetTypeToStr(order.banquet_type)}}</view>
			</view>
			<view class="hs-list-item" v-if="order.hall && order.hall.length > 0">
				<view class="hs-list-item-left">宴会厅</view>
				<view class="hs-list-item-right" >
				<van-tag type="success" :key="item.id" v-for="item in order.hall">{{item.title}}</van-tag>
				</view>
			</view>
			<view class="hs-list-item" v-if="order.bridegroom">
				<view class="hs-list-item-left"><text>新郎姓名</text></view>
				<view class="hs-list-item-right">{{ order.bridegroom }}</view>
			</view>
			<view class="hs-list-item" v-if="order.bridegroom_mobile">
				<view class="hs-list-item-left"><text>新郎电话</text></view>
				<view class="hs-list-item-right">{{ order.bridegroom_mobile }}</view>
			</view>
			<view class="hs-list-item" v-if="order.bride">
				<view class="hs-list-item-left"><text>新娘姓名</text></view>
				<view class="hs-list-item-right">{{ order.bride }}</view>
			</view>
			<view class="hs-list-item" v-if="order.bride_mobile">
				<view class="hs-list-item-left"><text>新娘电话</text></view>
				<view class="hs-list-item-right">{{ order.bride_mobile }}</view>
			</view>
			<view class="hs-list-item" v-if="order.sign_date && order.news_type != 11 && order.news_type != 12">
				<view class="hs-list-item-left"><text>签约时间</text></view>
				<view class="hs-list-item-right">{{ order.sign_date }}</view>
			</view>
			<view class="hs-list-item" v-if="order.event_date">
				<view class="hs-list-item-left"><text>举办时间</text></view>
				<view class="hs-list-item-right">{{ order.event_date }}</view>
			</view>

			<view class="hs-list-item" v-if="order.is_new_product">
				<view class="hs-list-item-left">是否研发产品</view>
				<view class="hs-list-item-right">{{ order.is_new_product ? '是' : '否' }}</view>
			</view>
			<view class="hs-list-item" v-if="order.new_product_no">
				<view class="hs-list-item-left">研发产品编号</view>
				<view class="hs-list-item-right">{{ order.new_product_no }}</view>
			</view>
			
			<view class="hs-list-item" v-if="order.idcard">
				<view class="hs-list-item-left"><text>身份证号</text></view>
				<view class="hs-list-item-right">{{ order.idcard }}</view>
			</view>
			<view class="hs-list-item" v-if="order.home_address">
				<view class="hs-list-item-left"><text>家庭住址</text></view>
				<view class="hs-list-item-right">{{ order.home_address }}</view>
			</view>
			</template>
			<view class="hs-image-group hs-list-border-top" v-if="order.image && order.image.length">
				<view class="hs-image-title">合同照片</view>
				<view class="hs-image-box">
					<template v-for="(img,index) in order.image">
						<image class="img" :key="index" mode="widthFix" :src="img" @click="picture.preViewImage(order.image)"></image>
					</template>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import picture from '@/utils/picture.js';
import dictionary from '@/utils/dictionary.js';

export default {
	props: {
		order: Object,
	},
	
	beforeCreate() {
		this.picture = picture;
		this.dictionary = dictionary;
	 console.log(this.dictionary.order)
	}
};
</script>

<style lang="less">
@import url('../common.less');
.hs-list-item .hs-list-item-right{
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.van-tag{
	margin-left: 5px;
}
</style>
